<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: hp
  Date: 2020/11/13
  Time: 22:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%@ taglib prefix="c" uri ="http://java.sun.com/jsp/jstl/core"%>
</head>
<body>
<%--遍历数字--%>
遍历数字
<c:forEach begin="1" end="10" step="2" var="ww">
    <h1>${ww}</h1>
</c:forEach>
<%--遍历数组--%>
遍历数组
<% pageContext.setAttribute("String",new String[]{"10","20","30","40"});%>
<c:forEach items="${String}" var="String">
    <h1>${String}</h1>
</c:forEach>
遍历map<br>
<% Map<String,String> map = new HashMap<>();
    map.put("key1","我是map1");
    map.put("key2","我是map1");
    map.put("key3","我是map3");
    map.put("key4","我是map4");
    pageContext.setAttribute("map",map);
%>
<c:forEach items="${map}" var="map1">
    ${map1.key}=======${map1.value}<br>
</c:forEach>
<hr>
<c:set scope="page" var="high" value="170"></c:set>
<c:set scope="session" var="key" value="value"/>
${key}
<c:if test="${key=='value'}">
    <h1>hello</h1>
</c:if>
<c:choose>
    <c:when test="${high>'200'}">
        <h1>高于两米</h1>
    </c:when>
    <c:when test="${high>='180'}">
        <h1>高于180</h1>
    </c:when>
    <c:when test="${high<'100'}">
        <h1>小于100</h1>
    </c:when>
    <c:otherwise>
        <h1>什么也不是!!!</h1>
    </c:otherwise>
</c:choose>
</body>
</html>
